<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/11/28
  Time: 3:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员一周免密</title>
</head>
<body>
<%
    response.setContentType("html/text;charset=utf-8");
    Cookie cookie=new Cookie("username","scd");
    response.addCookie(cookie);
    System.out.println("一周免密码登录!");
    response.sendRedirect("manage.jsp");
    //设置cookie保存时间为一周
    cookie.setMaxAge(7*24*3600);
    System.out.println("cookie的有效时间为:"+cookie.getMaxAge());

%>
</body>
</html>
